var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __reExport = (target, module2, desc) => {
  if (module2 && typeof module2 === "object" || typeof module2 === "function") {
    for (let key of __getOwnPropNames(module2))
      if (!__hasOwnProp.call(target, key) && key !== "default")
        __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
  }
  return target;
};
var __toModule = (module2) => {
  return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};

// app.ts
var fs = __toModule(require("fs"));
var events = __toModule(require("events"));
var Watcher = class extends events.EventEmitter {
  constructor(watchDir2, processedDir2) {
    super();
    this.watchDir = watchDir2;
    this.processedDir = processedDir2;
  }
  watch() {
    fs.readdir(this.watchDir, (err, files) => {
      if (err)
        throw err;
      for (var index in files) {
        this.emit("process", files[index]);
      }
    });
  }
  start() {
    fs.watchFile(this.watchDir, () => {
      this.watch();
    });
  }
};
var watchDir = "src";
var processedDir = "dist";
var watcher = new Watcher(watchDir, processedDir);
watcher.on("process", (file) => {
  console.log("[watcher] file:", file);
  console.log(`${watchDir}/${file}`);
});
watcher.start();
